﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Framework;
using Infrastructure.DataObjects;
using Domain.Module.Events;
using Framework.Event;


namespace Domain.Module.Entities
{
    public partial class Item : DbEntity, IAggregateRoot
	{
        #region ICommentAddedable Members
        public abstract CommentType CommonType{get;}
        #endregion


        public void BeCommented(Comment comment)
        {
            SendEvent(new CommentEvent
            {
                Comment = comment,
                Author = comment.Publisher,
                ObjectID = ID
            });
        }


        [Handles(typeof(CommentEvent))]
        protected virtual void HandleCommentEvent(CommentEvent e)
        {
            Console.Write("Item " + e.ToString());
        }

    }
}
